package spindles.api.domain;

import spindles.api.util.ErrorMessages;
import spindles.api.util.UserException;


public enum SamplingRate {
	
	SR128(128),
	SR256(256),
	SR512(512);
	
	
	private int value;
	
	SamplingRate(int value){
		this.value = value;
	}
	
	public int value(){
		return value;
	}
	
	public static SamplingRate toEnum(int samplingRate) throws UserException{
		switch(samplingRate){
		case 128:
			return SR128;
		case 256:
			return SR256;
		case 512:
			return SR512;
		default:
			throw new UserException(ErrorMessages.INVALID_SAMPLING_RATE);
		}
	}
	
	

}
